#!/usr/bin/env bash

if [[ "$(uname -s)" == "Linux" ]]; then
	if type dnf &>/dev/null; then
		sudo dnf -y install git git-lfs
	elif type apt &>/dev/null; then
		echo "deb https://mirrors.nju.edu.cn/debian/ bookworm main contrib non-free non-free-firmware" | tee /etc/apt/sources.list >/dev/null
		echo "deb https://mirrors.nju.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware" | tee -a /etc/apt/sources.list >/dev/null
		echo "deb https://mirrors.nju.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware" | tee -a /etc/apt/sources.list >/dev/null
		echo "deb https://mirrors.nju.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware" | tee -a /etc/apt/sources.list >/dev/null
		apt update
	elif type zypper &>/dev/null; then
		sudo zypper install -y git git-lfs
	elif type mamba &>/dev/null; then
		mamba install git git-lfs -y
	fi
fi
# sudo bash -c "cat >/etc/apt/sources.list <<EOF
# deb https://mirrors.bfsu.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
# deb https://mirrors.bfsu.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
# deb https://mirrors.bfsu.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
# deb https://mirrors.bfsu.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware
# EOF"
